import java.util.Scanner;

public class d074_電腦教室 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String input, output;
		int m;
		int n;
		int biggest_n;
		
		while(sc.hasNext()) {
			input = sc.nextLine();
			m = Integer.parseInt(input);
			
			biggest_n = 0;
			for(int i = 0; i < m; i++) {
				n = sc.nextInt();
				if(n > biggest_n)
					biggest_n = n;
			}
			
			output = Integer.toString(biggest_n);
			
			System.out.println(output);
		}
	}
	
}